#pragma once

#include "s3eTypes.h"
#include <IwGeomFVec2.h>

class FVec2RingBuffer {

public:
	explicit FVec2RingBuffer();
	
	void Create( int max_size );
	void Destroy();
	
	uint GetCount() const;
	
	uint GetMaxSize() const;
	
	void Push( CIwFVec2 node );
	// offset from the currently active start node
	CIwFVec2 Peek( uint offset ) const;
	CIwFVec2 Pop();
	void Clear();
	
	// removes all nodes after the given offset
	void TrimAfter( uint offset );
	
private:
	CIwFVec2 *m_nodes;
	int m_max_size;
	uint m_start;
	uint m_count;
};
